import type { GetCodeData, GetCodeParams, LoginCodeParams, userData, userInfo, userParams } from "@/types/user";
import { request } from "@/utils/http";
// 账号密码登录
export const loginApi = (data: userParams) => {
    return request.post<null, userData>('/login/password', data)
}
// 获取验证码
export const getCodeApi = (params:GetCodeParams) => {
    return request.get<null,GetCodeData>('/code', { params })
}

// 验证码登录
export const loginByMobileApi = (data:LoginCodeParams) => {
    return request.post<null,userData>('/login',data)
}

// 获取用户信息
export const userInfoApi = () => {
    return request.get<null,userInfo>('/patient/myUser')
}